import { createSlice } from "@reduxjs/toolkit";
import { DEFAULT_LOCALE } from "../utils/i18n";

const initialState = {
  locale: DEFAULT_LOCALE,
};

const localeSlicer = createSlice({
  name: "locale",
  initialState,
  reducers: {
    changeLocaleLng(state, action) {
      state.locale = action.payload;
    },
  },
});

export const { changeLocaleLng } = localeSlicer.actions;
export default localeSlicer.reducer;
